import Vue from 'vue'
import VueRouter from 'vue-router'

// {
//     path: 'advocate',
//     name: '工作台',
//     component: () =>
//         import ('@/views/advocate/index.vue')
// },
// {
//     path: 'basicsdata',
//     name: '基础数据管理',
//     component: () =>
//         import ('@/views/basicsdata/index.vue')
// },
// {
//     path: 'vehicle',
//     name: '车辆管理',
//     component: () =>
//         import ('@/views/vehicle/index.vue')
// },
// {
//     path: 'employee',
//     name: '员工管理',
//     component: () =>
//         import ('@/views/employee/index.vue')
// },
// {
//     path: 'business',
//     name: '业务管理',
//     component: () =>
//         import ('@/views/business/index.vue')
// },
// {
//     path: 'dispatch',
//     name: '调度管理',
//     component: () =>
//         import ('@/views/dispatch/index.vue')
// }
// 引入文件
// import layout from "@/views/layout/index.vue"
// import login from "@/views/login/index.vue"
import layout from "@/layout/index.vue"


Vue.use(VueRouter)

const routes = [

    {
        path: '/login',
        component: () =>
            import ('@/views/login/index.vue')
    },
    {
        path: '/',
        component: layout, // 主页
        name: 'layout',
        redirect: '/advocate',
        children: [

            {
                path: 'advocate',
                name: '工作台',
                component: () =>
                    import ('@/views/advocate/index.vue')
            },
            // 基础数据管理
            {
                path: 'organization',
                name: '机构管理',
                component: () =>
                    import ('@/views/basicsdata/organization/index.vue')
            },
            {
                path: 'range',
                name: '机构作业范围',
                component: () =>
                    import ('@/views/basicsdata/range/index.vue')
            },
            {
                path: 'freight',
                name: '运费管理',
                component: () =>
                    import ('@/views/basicsdata/freight/index.vue')
            },
            // 车辆管理
            {
                path: 'vehicle',
                name: '车型管理',
                component: () =>
                    import ('@/views/vehicle/vehicle/index.vue')
            },
            {
                path: 'tabulation',
                name: '车辆列表',
                component: () =>
                    import ('@/views/vehicle/tabulation/index.vue')
            },
            {
                path: 'registration',
                name: '回车登记',
                component: () =>
                    import ('@/views/vehicle/registration/index.vue')
            },
            // 员工管理
            {
                path: 'Courier',
                name: '快递管理',
                component: () =>
                    import ('@/views/employee/Courier/index.vue')
            },
            {
                path: 'driver',
                name: '司机管理',
                component: () =>
                    import ('@/views/employee/driver/index.vue')
            },
            {
                path: 'Scheduling',
                name: '排班管理',
                component: () =>
                    import ('@/views/employee/Scheduling/index.vue')
            },
            // 业务管理
            {
                path: 'order',
                name: '订单管理',
                component: () =>
                    import ('@/views/business/order/index.vue')
            },
            {
                path: 'waybill',
                name: '运单管理',
                component: () =>
                    import ('@/views/business/waybill/index.vue')
            },
            // 调度管理
            {
                path: 'Dispatch',
                name: '运输任务管理',
                component: () =>
                    import ('@/views/dispatch/Dispatch/index.vue')
            },
            {
                path: 'line',
                name: '线路管理',
                component: () =>
                    import ('@/views/dispatch/line/index.vue')
            },
            {
                path: 'obtain',
                name: '取件作业管理',
                component: () =>
                    import ('@/views/dispatch/obtain/index.vue')
            },
            {
                path: 'Transportation',
                name: '派件作业管理',
                component: () =>
                    import ('@/views/dispatch/Transportation/index.vue')
            }

        ]
    },
    {
        path: '*',
        name: '/404',
        component: () =>
            import ('@/404.vue')
    }

]

const router = new VueRouter({
    routes
})

export default router